package cn.tedu.crm.dashboard.controller;

import cn.tedu.crm.base.response.JsonResult;
import cn.tedu.crm.dashboard.pojo.vo.*;
import cn.tedu.crm.dashboard.service.DashboardService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/dashboard/")
@Slf4j
public class DashboardController {
    @Autowired
    private DashboardService dashboardService;

    @GetMapping("/taskList/select")
    public JsonResult selectTaskList(){
        List<TaskVO> list = dashboardService.selectTaskList();
        return JsonResult.success(list);
    }

    @GetMapping("rank/select")
    public JsonResult selectRankList(){
        List<RankVO> list = dashboardService.selectRankList();
        return JsonResult.success(list);
    }

    @GetMapping("orderStats/select")
    public JsonResult selectorderStats(){
        List<OrderStatsVO> list = dashboardService.selectorderStats();
        return JsonResult.success(list);
    }

    @GetMapping("visitStats/select")
    public JsonResult selectorderVisitStats(){
        List<VisitStatsVO> list = dashboardService.selectorderVisitStats();
        return JsonResult.success(list);
    }

    @GetMapping("productionStats/select")
    public JsonResult selectorderProductionStats(){
        ProductionStatsVO list =dashboardService.selectorderProductionStats();
        return JsonResult.success(list);
    }


}
